<!--Generate by Kevin's CodeBuilder 2022-01-29 11:18:36-->
<!DOCTYPE html>
<html xmlns:th="http://www.thymeleaf.org">
<head>
    <meta charset="UTF-8">
    <title></title>
    <head th:replace="source::header">
    </head>
</head>
<body>
    <div id="k_page_erea" class="form_main_wrap">
        <div class="k_form_grid">
            <table id="datagrid"></table>
        </div>
        <div class="k_form_condition" style="padding:12px 14px;">
            <table class="k_form_table" id="k_form_query_wrap">
                <tr>
                    <td class="label label100">[(${Lang.common_query_from})]</td>
                    <td><input id="keywords" name="keywords" placeholder="类型ID或者key" class="form_input form_input30" type="text" />
                        <span style="padding-left:30px">
                              <button class="k_common_button" id="search_btn">
                                <i class="fa fa-search"></i>
                                [(${Lang.common_search})]
                            </button>
                        </span>
                    </td>
                </tr>
            </table>
        </div>
    </div>
    </div>
    <script type="application/javascript" th:inline="javascript">
         var curdObj,
             height = 400,
             gridOpts = [(${dataGridJson})],//获取datagrid配置json
             title = "[(${Lang.dict_windowTitle})]";//国际化语言
             gridOpts.title = title;

         $B.DomUtils.onDomLoaded(function () {
             var dg =  document.getElementById("datagrid");
             //设置查询参数
             gridOpts.setParams = function(){
                 return {};
             };
             gridOpts.title = "";
             gridOpts.pageArea = "k_page_erea";
             gridOpts.fit2height = true;
             gridOpts.oprColWidth = 235;
             gridOpts.onCreateCheckbox = function(td,data){
                 if(data.typeid === "dbWorkId"){
                     $B.DomUtils.addClass(td.firstChild,"k_table_chk_disabled");
                 }
             };
             gridOpts.formatTipFn = function(fieldName,data){
                 if(data.typeid === "dbWorkId"){
                     if(fieldName === "desp" || fieldName === "typeid"){
                         return {
                             text:"<div><h6 style='color: #FFFFFF'>提示：</h6><p style='color: #FFFFFF'>分布式部署场景下，每个应用的【value】值不可重复！该值由系统自行分配，无需人为修改！</p></div>",
                             color:"#BC4BE0"
                         };
                     }
                 }
             };
             curdObj = new $B.CURD(dg, gridOpts);

             //输入框绑定清理按钮
             $B.bindInputClear("k_form_query_wrap");

             $B.DomUtils.click(document.getElementById("search_btn"),()=>{
                  curdObj.reload();
             });
         });
         //打开form.html
        function _openForm(prs,isUpdate,winTitle){
             console.log(prs,isUpdate,winTitle);
             var opts = {
                 dataType:'html',
                 title:winTitle ? winTitle:title,
                 width:800,
                 height:height
             };
             if(prs){
                 opts.params = prs;
             }
             curdObj.window(opts,isUpdate);
         };
         /******工具栏事件集合******/
         window.buttonEvents = {
             addFn:function(prs){
                 _openForm(undefined,false,'[(${Lang.common_add_title})]');
             },
             updateFn:function(prs){
                 _openForm(undefined,true,'[(${Lang.common_update_title})]');
             },
             deleteFn:function(prs){
                 curdObj.delChecked();
             },
             lineUpdateFn:function(prs){
                 _openForm({id:prs.id},true,'[(${Lang.common_update_title})]');
             },
             lineDeleteFn:function(prs){
                 curdObj.deleteData([prs.id]);
             }
         };
    </script>
</body>
</html>
